﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;

namespace Kailua.net.windward.utils.ado.SPList.custom
{
    /// <summary>
    /// Provider factory for SPList data providers.
    /// </summary>
    public class SPListProviderFactory : DbProviderFactory
    {
        // from: http://ljusberg.com/blogs/smorakning/archive/2005/11/28/Custom-Data-Provider-_2800_continued_2900_.aspx
        // This is a field required for DbProviderFactories.GetFactory.
        /// <summary>
        /// Gets the single, static instance of SPListProviderFactory.
        /// </summary>
        public static SPListProviderFactory Instance = new SPListProviderFactory();

        /// <summary>
        /// Creates a new SPListConnection.
        /// </summary>
        /// <returns></returns>
        public override DbConnection CreateConnection()
        {
            return new SPListConnection();
        }
        /// <summary>
        /// Creates a new SPListCommand.
        /// </summary>
        /// <returns></returns>
        public override DbCommand CreateCommand()
        {
            return new SPListCommand();
        }
    }
}
